#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int countGoodSubstrings(string s)
    {
        if (s.size() < 3) return 0;
        int ret = 0;
        int pos = 0;
        while (pos + 2 < s.size())
        {
            string str = s.substr(pos, 3);
            if (str[0] != str[1] && str[1] != str[2] && str[0] != str[2])
            {
                ret++;
            }
            pos++;
        }
        return ret;

    }
};